<template>
  <div class="audit-handle">
    <!-- 标题区域（带图标） -->
    <div class="handle-header">
      <span class="header-icon el-icon-setting"></span>
      <h3>审核处理</h3>
    </div>

    <!-- 审核备注输入框 -->
    <el-input
      type="textarea"
      class="audit-textarea"
      placeholder="请输入审核备注说明"
      rows="3"
    />

    <!-- 按钮组：新增 .button-wrap 容器，实现水平居中 -->
    <div class="button-wrap">
      <div class="button-group">
        <el-button type="info" plain @click="handlePrevious">
          <span class="el-icon-arrow-left"></span> 上一页
        </el-button>
        <el-button type="success" @click="handleIgnoreRisk">忽略风险</el-button>
        <el-button type="danger" @click="handleConfirmRisk">确认风险</el-button>
        <el-button type="primary" @click="handleShare">分享</el-button>
        <el-button type="info" plain @click="handleNext">
          下一页 <span class="el-icon-arrow-right"></span>
        </el-button>
      </div>
    </div>
  </div>
</template>

<script setup lang="ts">
import { ElButton, ElInput } from 'element-plus'

// 上一页
const handlePrevious = () => {
  console.log('上一页')
}

// 忽略风险
const handleIgnoreRisk = () => {
  console.log('忽略风险')
}

// 确认风险
const handleConfirmRisk = () => {
  console.log('确认风险')
}

// 分享
const handleShare = () => {
  console.log('分享')
}

// 下一页
const handleNext = () => {
  console.log('下一页')
}
</script>

<style lang="scss" scoped>
.audit-handle {
  width: 100%;               // 继承父容器宽度（如 base-card 的 100%）
  background-color: #fff;
  border-radius: 8px;
  padding: 20px;
  box-sizing: border-box;    // 确保 padding 不撑大容器

  // 标题区域
  .handle-header {
    display: flex;
    align-items: center;
    margin-bottom: 12px;

    .header-icon {
      color: #409eff;
      font-size: 18px;
      margin-right: 8px;
    }

    h3 {
      margin: 0;
      font-size: 16px;
      font-weight: bold;
      color: #333;
    }
  }

  // 审核备注输入框
  .audit-textarea {
    margin-bottom: 20px;

    ::v-deep(.el-textarea__inner) {
      background-color: #f5f7fa;
      border: 1px solid #e6e6e6;
      border-radius: 8px;
      padding: 12px;
      font-size: 14px;
      resize: none;
    }
  }

  // 按钮包裹层：占满父容器宽度，实现居中
  .button-wrap {
    width: 100%;              // 占满父容器宽度
    display: flex;
    justify-content: center;  // 按钮组水平居中
  }

  // 按钮组：控制间距，避免拉伸
  .button-group {
    display: flex;
    align-items: center;
    gap: 0px;                // 按钮间间距
  }

  // 统一按钮样式
  ::v-deep(.el-button) {
    font-size: 6px;
    padding: 1px 6px;
  }

  // 翻页按钮优化（plain 样式）
  .el-button--info.is-plain {
    font-size: 8px;
    border-color: #c0c4cc;
    color: #606266;
    &:hover {
      border-color: #999;
      color: #333;
    }
  }
}
</style>
